package com.ac.app.web.form;

import java.math.BigDecimal;
import java.util.Date;

import com.ac.app.dm.PickInvest;
import com.caac.core.util.DateUtils;
import com.caac.core.web.form.BaseForm;

public class PickInvestForm extends BaseForm {
	private PickInvest dm;
	
	private String prjBegdate;
	
	private String prjEnddate;
	
	private String prjMoneyString;
	
	

	public String getPrjMoneyString() {
		return dm.getPrjMoney()==null?"":dm.getPrjMoney().toString();
	}

	public void setPrjMoneyString(String prjMoneyString) {
		this.prjMoneyString = prjMoneyString;
		if(prjMoneyString==null||"".equals(prjMoneyString)){
			dm.setPrjMoney(null);
		}else{
			dm.setPrjMoney(new BigDecimal(prjMoneyString));
		}
	}

	public PickInvest getDm() {
		return dm;
	}

	public void setDm(PickInvest dm) {
		this.dm = dm;
	}

	public String getPrjBegdate() {
		return prjBegdate;
	}

	public void setPrjBegdate(String prjBegdate) {
		this.prjBegdate = prjBegdate;
	}

	public String getPrjEnddate() {
		return prjEnddate;
	}

	public void setPrjEnddate(String prjEnddate) {
		this.prjEnddate = prjEnddate;
	}
	public Date getTime1() {
        try {
            return DateUtils.convertToDate("yyyy-MM-dd", this.prjBegdate);
        } catch (Exception e) {
            return null;
        }
    }

    public Date getTime2() {
        try {
            return DateUtils.convertToDate("yyyy-MM-dd", this.prjEnddate);
        } catch (Exception e) {
            return null;
        }
    }
}
